/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.mei;

import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;

/**
 * <p> 迭代枚举对象
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Enum2 {
    public static void main(String[] args) {
        Color c1 = Color.RED;
        Color c2 = Color.valueOf("RED");
        System.out.println(c1 == c2);
        System.out.println(Color.valueOf("RED"));
        System.out.println(c1.ordinal());
        System.out.println(c2.ordinal());
        for (var c : Color.values()) {
            System.out.println(c);
        }

        for (var i : ElementType.values()) {
            System.out.println(i);
        }

        for (var p : RetentionPolicy.values()) {
            System.out.println(p.ordinal());
            System.out.println(p);
        }


    }
}
